cmake_minimum_required(VERSION 3.13)
project(LibSDK)
add_compile_options(-std=c++11 -fpermissive)
# message(==========================,${CMAKE_SOURCE_DIR})


# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/../test_algo)


#opencv
include(cmake/FindOpenCV.cmake)
include_directories(${OpenCV_INCLUDE_DIRS})

#cuda
include(cmake/FindCUDA.cmake)
include_directories(${CUDA_INCLUDE_DIRS})
link_directories(${CUDA_LIBS_DIRS})
find_package(CUDA)

#tensorrt
include(cmake/FindTensorRT.cmake)
include_directories(${TENSORRT_INCLUDE_DIRS})
link_directories(${TENSORRT_LIBS_DIRS})

#omp
include(cmake/FindOpenMP.cmake)


#ALGOLIB
include(cmake/FindAlgolib.cmake)
include_directories(${ALGOLIB_INCLUDE_DIRS})
link_directories(${ALGOLIB_LIBS_DIRS})

# include_directories(algo_library/include)
# link_directories(algo_library/lib)

# set(SRC_LIST
#     main.cpp
# )

include_directories(test_code)


include_directories(${INSTALL_HEAD_FILES})
# INCLUDE_DIRECTORIES(${INSTALL_HEAD_FILES})
# add_library(${PROJECT_NAME} SHARED ${SRC_LIST})

add_executable(${PROJECT_NAME} main.cpp)


target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})#链接lib*.so 定义在/usr/local/share/OpenCV/OpenCVConfig.cmake里面

# 
target_link_libraries(${PROJECT_NAME} base_common)
target_link_libraries(${PROJECT_NAME} baseonnx2rt)
target_link_libraries(${PROJECT_NAME} segmentation)
target_link_libraries(${PROJECT_NAME} object_detection)
target_link_libraries(${PROJECT_NAME} face_detection)
target_link_libraries(${PROJECT_NAME} face_feature)
target_link_libraries(${PROJECT_NAME} face_align)


target_link_libraries(${PROJECT_NAME} nvonnxparser)
target_link_libraries(${PROJECT_NAME} nvinfer_plugin)
target_link_libraries(${PROJECT_NAME} nvinfer)
target_link_libraries(${PROJECT_NAME} cudart)
target_link_libraries(${PROJECT_NAME} nvrtc)
target_link_libraries(${PROJECT_NAME} cudnn)
target_link_libraries(${PROJECT_NAME} cublasLt)
target_link_libraries(${PROJECT_NAME} pthread) 
# install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
# install(FILES ${INSTALL_HEAD_FILES} DESTINATION  ${CMAKE_INSTALL_PREFIX}/include)





